﻿@model BrnShop.Web.Models.OrderAfterServiceModel
@{
    Layout = null;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>订单售后服务-@{@WorkContext.ShopConfig.SiteTitle}<</title>
    @Html.Raw(WorkContext.ShopConfig.SEOKeyword)
    @Html.Raw(WorkContext.ShopConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/ucenter.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/jquery.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
</head>

<body>
    @Html.Partial("_header")

    <div class="bigBox" id="member">
        <div class="box">
            @Html.Partial("_menu")
            <div id="memberR">
                <h2 id="memberRT">订单售后服务</h2>
                <table width="100%" border="0" cellspacing="0" class="dingdan">
                    <thead>
                        <tr>
                            <th>商品信息</th>
                            <th>价格</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (OrderProductInfo info in Model.OrderProductList)
                        {
                            OrderAfterServiceInfo orderAfterServiceInfo = Model.OrderAfterServiceList.Find(x => (x.RecordId == info.RecordId));
                        <tr>
                            <td>
                                <div class="proList">
                                    <img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@info.ShowImg" width="50" height="50" />
                                    <a href="@Url.Action("product", "catalog", new RouteValueDictionary {{ "pid" ,info.Pid }})">@info.Name</a>
                                    <div class="clear"></div>
                                </div>
                            </td>
                            <td style="vertical-align:middle;">@info.ShopPrice</td>
                            <td style="vertical-align:middle;">
                                @if (orderAfterServiceInfo != null)
                                {
                                switch ((OrderAfterServiceState)orderAfterServiceInfo.State)
                                {
                                    case OrderAfterServiceState.Checking:
                                    @:审核中
                                    break;
                                    case OrderAfterServiceState.CheckAgree:
                                    @:审核通过
                                    break;
                                    case OrderAfterServiceState.CheckRefuse:
                                    @:审核拒绝
                                    break;
                                    case OrderAfterServiceState.Sended:
                                    @:客户已邮寄
                                    break;
                                    case OrderAfterServiceState.Received:
                                    @:商城已收货
                                    break;
                                    case OrderAfterServiceState.Backed:
                                    @:商城已发货
                                    break;
                                    case OrderAfterServiceState.Completed:
                                    @:完成
                                    break;
                                    default:
                                    @:未知状态
                                    break;
                                }
                                }
                            </td>
                            <td style="vertical-align:middle;">
                                @if (orderAfterServiceInfo == null)
                                {
                                    <a href="@Url.Action("applyorderafterservice", new RouteValueDictionary {{ "oid", info.Oid },{ "recordId", info.RecordId }})">申请</a>
                                }
                                else 
                                {
                                    if (orderAfterServiceInfo.State == (int)OrderAfterServiceState.CheckAgree)
                                    {
                                        <a href="@Url.Action("sendorderafterservice", new RouteValueDictionary { { "asId", orderAfterServiceInfo.ASId } })">邮寄</a>
                                    }
                                    else if (orderAfterServiceInfo.State == (int)OrderAfterServiceState.Backed)
                                    {
                                        <a href="@Url.Action("completeorderafterservice", new RouteValueDictionary { { "asId", orderAfterServiceInfo.ASId } })">完成</a>
                                    }
                                    else if (orderAfterServiceInfo.State == (int)OrderAfterServiceState.CheckRefuse || orderAfterServiceInfo.State == (int)OrderAfterServiceState.Completed)
                                    { 
                                        <a href="@Url.Action("applyorderafterservice", new RouteValueDictionary {{ "oid", info.Oid },{ "recordId", info.RecordId }})">申请</a>
                                    }
                                    <a href="@Url.Action("orderproductafterservicelist", new RouteValueDictionary { { "recordId", orderAfterServiceInfo.RecordId } })">查看</a>
                                }
                            </td>
                        </tr>
                        }
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>

    @Html.Partial("_footer")
</body>
</html>